package lagou.FileTest;

import java.io.*;

public class BufferCharCopyTest {
    public static void main(String[] args) {
        BufferedReader f1 = null;
        BufferedWriter w1 = null;
        try {
            f1 = new BufferedReader(new FileReader("D:/a.txt"));
            w1 = new BufferedWriter(new FileWriter("D:/b.txt"));
            String str = null;
            System.out.println("玩命写入中");
            while ((str = f1.readLine())!=null){
                w1.write(str);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            try {
                w1.close();
                f1.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        System.out.println("成功");
    }
}
